import request from '@/utils/request'
/**
 * 获取计费列表
 * http://192.168.88.247:4999/web/#/283/2506 Dqp2zDvz
 * @returns
 */
export function getFormulaList (params) {
  return request({
    url: '/charge/admin/api/v1/fn/formula',
    method: 'get',
    params
  })
}
/**
 * 创建功能id的计费价格
 * http://192.168.88.247:4999/web/#/283/2505 Dqp2zDvz
 * @returns
 */
export function addFormula (data, method = 'post') {
  return request({
    url: '/charge/admin/api/v1/fn/formula',
    method,
    data
  })
}
/**
 * 核销
 * http://192.168.88.247:4999/web/#/283/2505 Dqp2zDvz
 * @returns
 */
export function heXiao (data, method = 'post') {
  return request({
    url: '/charge/admin/api/v1/charge_user_unit_count',
    method,
    data
  })
}
/**
 * 获取功能id列表
 * http://192.168.88.247:4999/web/#/283/2504 Dqp2zDvz
 * @returns
 */
export function getFnList (params) {
  return request({
    url: '/charge/admin/api/v1/fn/list',
    method: 'get',
    params
  })
}
/**
 * 添加功能id
 * http://192.168.88.247:4999/web/#/283/3332 Dqp2zDvz
 * @returns
 */
export function addFn (data, method = 'post') {
  return request({
    url: '/charge/admin/api/v1/fn/add',
    method,
    data
  })
}
/**
 * 修改功能id
 * http://192.168.88.247:4999/web/#/283/3333 Dqp2zDvz
 * @returns
 */
export function updateFn (data, method = 'put') {
  return request({
    url: '/charge/admin/api/v1/fn/update',
    method,
    data
  })
}
/**
 * 删除功能id
 * http://192.168.88.247:4999/web/#/283/3334 Dqp2zDvz
 * @returns
 */
export function deleteFn (data, method = 'delete') {
  return request({
    url: '/charge/admin/api/v1/fn/delete',
    method,
    data
  })
}

/**
 * 获取加购包列表
 * http://192.168.88.247:4999/web/#/80/2488
 * @returns
 */
export function getPackageList (params) {
  return request({
    url: '/api/v1/addition_package/list',
    method: 'get',
    params
  })
}
/**
 * 获取加购包详情列表
 * http://192.168.88.247:4999/web/#/80/2488
 * @returns
 */
export function getPackageDetailList (params) {
  return request({
    url: '/v1/user/charge_list',
    method: 'get',
    params
  })
}
/**
 * 获取加购包详情个人列表
 * http://192.168.88.247:4999/web/#/80/2488
 * @returns
 */
export function getPackageDetailInfoList (params) {
  return request({
    url: '/charge/admin/api/v1/user_charge_bill',
    method: 'get',
    params
  })
}
/**
 * 创建加购包
 * http://192.168.88.247:4999/web/#/80/2487
 * @returns
 */
export function addPackage (data) {
  return request({
    url: '/api/v1/addition_package/add',
    method: 'post',
    data
  })
}

/**
 * 创建加购包
 * http://192.168.88.247:4999/web/#/80/2489
 * @returns
 */
export function updatePackage (data) {
  return request({
    url: '/api/v1/addition_package/update',
    method: 'put',
    data
  })
}

/**
 * 获取项目限制信息
 * http://192.168.88.247:4999/web/#/283/3363 Dqp2zDvz
 * @returns
 */
export function getUseLimitList (params) {
  return request({
    // eslint-disable-next-line sonarjs/no-duplicate-string
    url: '/charge/admin/api/v1/usage_limit',
    method: 'get',
    params
  })
}
/**
 * 添加项目限制
 * http://192.168.88.247:4999/web/#/283/3362 Dqp2zDvz
 * @returns
 */
export function addUseLimit (data) {
  return request({
    url: '/charge/admin/api/v1/usage_limit',
    method: 'post',
    data
  })
}
/**
 * 更新项目限制信息
 * http://192.168.88.247:4999/web/#/283/3365 Dqp2zDvz
 * @returns
 */
export function updateUseLimit (data, method = 'put') {
  return request({
    url: '/charge/admin/api/v1/usage_limit',
    method,
    data
  })
}
/**
 * 删除功能id
 * http://192.168.88.247:4999/web/#/283/3364 Dqp2zDvz
 * @returns
 */
export function deleteUseLimit (data) {
  return request({
    url: '/charge/admin/api/v1/usage_limit',
    method: 'delete',
    data
  })
}
